package com.flst;

import com.google.inject.Inject;

public class PersonService {

	@Inject
	PersonDAO personDAO;
	
	@Inject
	BookDAO bookDAO;
	
	public Person addNewPerson(String string) {
		Person person = new Person(string);
		return personDAO.savePerson(person);
	}
	
	
	public Person borrowBook(Person person, Book book) {
		person.getListBook().add(book);	
		book.setBorrower(person);
		bookDAO.saveBook(book);
		return personDAO.savePerson(person);
	}
	
	
	
}
